/**
 * Created by chengming on 18/4/23.
 * version 1.0
 */
"use strict";
const logger = require('../conf/logger');
const request = require('request-promise');
const urlTool = require('url');
const server = require('../conf/server');


module.exports = async function(sourceSite, title, detailSite, note){

	let options = {
		url: urlTool.resolve(server.addr, "/spider/add/log"),
		method:'POST',
		body:{
			pageSite:sourceSite,
			pageTitle:title,
			detailSite:detailSite,
			note:note
		},
		json:true
	};
	try{
        let echo = await request(options);
        logger.debug("上报错误响应:"+JSON.stringify(echo));
		logger.debug('上报错误');
	}catch(e){
		logger.error(e);
	}

}